package com.ruoyi.jypc.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.jypc.mapper.DepartmentMapper;
import com.ruoyi.jypc.domain.Department;
import com.ruoyi.jypc.service.IDepartmentService;

/**
 * 系部信息Service业务层处理
 * 
 * @author HWJ
 * @date 2022-10-17
 */
@Service
public class DepartmentServiceImpl implements IDepartmentService 
{
    @Autowired
    private DepartmentMapper departmentMapper;

    /**
     * 查询系部信息
     * 
     * @param departmentid 系部信息主键
     * @return 系部信息
     */
    @Override
    public Department selectDepartmentByDepartmentid(String departmentid)
    {
        return departmentMapper.selectDepartmentByDepartmentid(departmentid);
    }
    
    
    /**
     * 查询系部信息列表
     * 
     * @param department 系部信息
     * @return 系部信息集合
     */
    public List<Department> selectDepartmentListAll(){
    	return departmentMapper.selectDepartmentListAll();
    }
    
    
    
    /**
     * 根据系部名称查询系部信息
     * @param departmentName 系部名称
     * @return 系部信息
     */
    @Override
    public Department selectDepartmentByDepartmenName(String departmentName)
    {
    	return departmentMapper.selectDepartmentByDepartmenName(departmentName);
    }

    /**
     * 查询系部信息列表
     * 
     * @param department 系部信息
     * @return 系部信息
     */
    @Override
    public List<Department> selectDepartmentList(Department department)
    {
        return departmentMapper.selectDepartmentList(department);
    }

    /**
     * 新增系部信息
     * 
     * @param department 系部信息
     * @return 结果
     */
    @Override
    public int insertDepartment(Department department)
    {
        department.setCreateTime(DateUtils.getNowDate());
        return departmentMapper.insertDepartment(department);
    }

    /**
     * 修改系部信息
     * 
     * @param department 系部信息
     * @return 结果
     */
    @Override
    public int updateDepartment(Department department)
    {
        department.setUpdateTime(DateUtils.getNowDate());
        return departmentMapper.updateDepartment(department);
    }

    /**
     * 批量删除系部信息
     * 
     * @param departmentids 需要删除的系部信息主键
     * @return 结果
     */
    @Override
    public int deleteDepartmentByDepartmentids(String[] departmentids)
    {
        return departmentMapper.deleteDepartmentByDepartmentids(departmentids);
    }

    /**
     * 删除系部信息信息
     * 
     * @param departmentid 系部信息主键
     * @return 结果
     */
    @Override
    public int deleteDepartmentByDepartmentid(String departmentid)
    {
        return departmentMapper.deleteDepartmentByDepartmentid(departmentid);
    }
}
